<?php
/**
 * Html Helper
 *
 * @author hiscaler <hiscaler@gmail.com>
 * @link http://www.yuandot.com/
 * @copyright Copyright &copy; 2009-2010 Yuandot Information Technology CO.,LTD.
 * @license http://doit.yuandot.com/license/
 */
class YHtml extends CHtml {

    /**
     * 资源来源
     * @param <string> $media_file
     * @param <boolean> $is_backend
     * @return string media url
     */
    public static function mediaUrl($media_file, $is_backend = false) {
        return ($is_backend)
            ? Yii::app()->baseUrl . '/assets/backend/' . $media_file
            : Yii::app()->baseUrl . '/upload/' . $media_file;
    }

    // 文件上传目录
    public static function uploadPath($media_file) {
        return Yii::getPathOfAlias('webroot') . '/upload/' . $media_file;
    }

    // 文件来源路径
//    public static function mediaUrl()
}

